{% extends '::base.html.twig' %}
{% block title %}Administrar Mallas Curriculares{% endblock %}

{% block greensectiontitle %}Buscar Malla Curricula{% endblock %}
{% block greensectionbody %}
    <form id="searchForm" action="{{ path('mallacurricular') }}" method="post" {{ form_enctype(search_form) }}>
        {{ form_label(search_form.nombre,'Universidad') }}{{ form_widget(search_form.nombre) }}<br/>
        {{ form_widget(search_form.nombre) }}<br/>
        <div class="search_controls"><a title="Buscar malla curricular por universidad"id="searchButton" href="#">Buscar</a></div>
    </form>
{% endblock %}

{% block body %}

    
    {% set eliminar = app.request.query.get('eliminar') %}
    {% if eliminar != null %} 
    <h3>  La malla curricular [{{eliminar}}] se elimino correctamente!</h3>
    {% endif %}

    
    <div id="records_table">
        <table>
            <thead>
                <tr>
                    <th colspan="5">
                        <div id="controls">
                            Lista de Mallas Curriculares
                            <a title="Crear nueva malla curricular" href="{{ path('mallacurricular_new') }}" style="float:right;">Nueva Malla Curricular</a>
                        </div>
                    </th>
                </tr>

                <tr>
                    <th>Id</th>
                    <th>Universidad</th>
                    <th>Carrera</th>
                    <th>Año Pensun</th>

                    <th>Acciones</th>
                </tr>
            </thead>
            <tbody>
                {% for entity in entities %}
                    <tr>
                        <td><a href="{{ path('mallacurricular_show', { 'id': entity.id }) }}">{{ entity.id }}</a></td>
                        <td>{{ entity.universidad }}</td>
                        <td>{{ entity.carrera }}</td>
                        <td>{{ entity.anio }}</td>
                        <td>
                            <div id="controls" style="text-align: center;">
                                <a title="Eliminar malla curricular" href="{{ path('mallacurricular_show', { 'id': entity.id }) }}">Eliminar</a>
                                <a title="Editar malla curricular"href="{{ path('mallacurricular_edit', { 'id': entity.id }) }}">Editar</a>
                            </div>
                        </td>
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    </div>
{% endblock %}